UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QhHlycNRuAPSpaJgjFhO93kmU8AlYMai5pr2vM0OSqw='
WHERE
key_id = '32b96e410e9a7ccdc372ce8cfce3d4232fee70ae29c7af863f46438cb4ca8653'
AND (
token = 'QhHlycNRuAPSpaJgjFhO93kmU8AlYMai5pr2vM0OSqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)