UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '036MOkAzqr2D7pCYvhcuzTYKA4ObuNyJCRQTKXObaSk=' 
WHERE 
  key_id = '1190ddf09e0339748bef47a7af6622ea584a72a74d84ca53f7b7197e2f44e817' 
  AND (
    token = '036MOkAzqr2D7pCYvhcuzTYKA4ObuNyJCRQTKXObaSk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030