UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cbwlm1PkPiJ/VKORLXBrV2djj4OR2cwdgYPxt4RZm24='
WHERE
key_id = '5e5627c0d33386d93ea10af88e7be74aec21306bb7b30c7a1c2462e8018fa31b'
AND (
token = 'cbwlm1PkPiJ/VKORLXBrV2djj4OR2cwdgYPxt4RZm24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)