UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iQ+bRhsVLXcVKNREnZREM5+NKj0mkij1Q5uppW5wKsU='
WHERE
key_id = 'a46989bd59d3eabca1015666c5699fa883062c3e261c91469dddd784b620cf60'
AND (
token = 'iQ+bRhsVLXcVKNREnZREM5+NKj0mkij1Q5uppW5wKsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)