UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jpfCZRfRVgFCj86URJ2Tzy8RpWPYWaJk/kusvzMiI4Y='
WHERE
key_id = 'bd7d8cc87bc6d82240e53e8c552fcd8e68f4b8371abe02f10dce893edd24ecbe'
AND (
token = 'jpfCZRfRVgFCj86URJ2Tzy8RpWPYWaJk/kusvzMiI4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)