UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tHXz494oXWzbLt6LLx4g2nCGvxqgMNi53AKNGSgVJL0=' 
WHERE 
  key_id = '13be4f1ed604654be584876ef1f57dff1c215cacbe325d3756d013d6b6a490cb' 
  AND (
    token = 'tHXz494oXWzbLt6LLx4g2nCGvxqgMNi53AKNGSgVJL0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042