UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aDcdUP4tj0xFrEsYY5d9ad4YUPn7T4Csb22KYhKq/ok='
WHERE
key_id = 'be8a2762162d5c5e0d11ab0f1359d62b46bac1e9931943c7a3a7fd0a5d082cb9'
AND (
token = 'aDcdUP4tj0xFrEsYY5d9ad4YUPn7T4Csb22KYhKq/ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)