UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EOogyMrRNyg1E7cRpHsheb1uGlnljJg3rOd9FFlsTwM=' 
WHERE 
  key_id = '0d900c1c5a22992f2dc8a24e58e7367187c4f45ede2c0dcda4f10ccf7a996d3e' 
  AND (
    token = 'EOogyMrRNyg1E7cRpHsheb1uGlnljJg3rOd9FFlsTwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036