UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YuccqElWX070l7kESXDDgP7xJny/bO2OwasAI7/nl88=' 
WHERE 
  key_id = 'b0bb0e5b0f6921613a5dd8e2fc3351e46a4eaeaecbb8c6d203fcb8976f09533d' 
  AND (
    token = 'YuccqElWX070l7kESXDDgP7xJny/bO2OwasAI7/nl88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033