UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8odv8AotqpzPS1w4smAq1cUP+Aw9crasouXH+in9d2g=' 
WHERE 
  key_id = 'ce2673f9b8a31e91fb8246866ded5c9c3d3333a00bb06154beddc067667b7a12' 
  AND (
    token = '8odv8AotqpzPS1w4smAq1cUP+Aw9crasouXH+in9d2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030