UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SqfuiFfs2XHlBgketp1/FhPUl82f4CdJiPv7Edc5ox0='
WHERE
key_id = 'd20188440fbd0492bd989c0b997559917a03810c36dc9d8fe31da50a7e5abff8'
AND (
token = 'SqfuiFfs2XHlBgketp1/FhPUl82f4CdJiPv7Edc5ox0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)