UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3zbA0CWIq72ddO7hQraTAAVSs/ferhyyq4Z6mIA2q4A='
WHERE
key_id = 'b1f75e0b8acb58788804fd4d25a511c6b29a60211ac35c7c42635c49b654466c'
AND (
token = '3zbA0CWIq72ddO7hQraTAAVSs/ferhyyq4Z6mIA2q4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)