UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmVpMn1br8rNAmJSbRhYa7Q6/Qc/1Qu46+3PwNTpeYw=' 
WHERE 
  key_id = '292247bd6cd0fce0cd5967fa1b77d555e0293e73b85ca310d08d0f524d5dbc43' 
  AND (
    token = 'ZmVpMn1br8rNAmJSbRhYa7Q6/Qc/1Qu46+3PwNTpeYw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034