UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KbpgTOplndD7tlGmbgV6++mo1Z3e+3eBWyTu2bYpxo='
WHERE
key_id = '6a9a79efd54736f380a23e67ecada60920e91e85e8a517ddda50bb40124807c1'
AND (
token = '4KbpgTOplndD7tlGmbgV6++mo1Z3e+3eBWyTu2bYpxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)