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