UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BIoVCdWtz0YzSLxhJlOCbjIEiedQ/3qIhlQixA4Jqxo='
WHERE
key_id = '371b0b12629661a7baa11d263408f7c65d643404ca25f08422d4595a09e9a8e0'
AND (
token = 'BIoVCdWtz0YzSLxhJlOCbjIEiedQ/3qIhlQixA4Jqxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)