UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUG+kKWbfrsMB3zJ49Pqtn7tVuYtuORlHRAmRJ0WzCI='
WHERE
key_id = '181e0fed05b4480b8d7dd3ff154af5033812c97f52275f12a423e785a23293a3'
AND (
token = 'oUG+kKWbfrsMB3zJ49Pqtn7tVuYtuORlHRAmRJ0WzCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)