UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bx/D+VodMLyw7hc3XwJpaKQ8zpxkqTEoU+rFthlerq0=' 
WHERE 
  key_id = '6c694861943aaa124637faa366bd05226e920ec9fd6c44ae8d834b54b1248aca' 
  AND (
    token = 'Bx/D+VodMLyw7hc3XwJpaKQ8zpxkqTEoU+rFthlerq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020