UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q6Im6UOrxHkzVHbt3X7OQesMGhxgGC2DBW9bQSm5grY=' 
WHERE 
  key_id = 'a70cafa4a8d26be2242b1ccaffd9c67e60f756627073c16e1f38f47beef84a36' 
  AND (
    token = 'Q6Im6UOrxHkzVHbt3X7OQesMGhxgGC2DBW9bQSm5grY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030