UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tdx85yQDXEmOY9M3XOu/KD/7jww235Z+ZfLDPSlqR7M='
WHERE
key_id = '1cb426dcf332e261dcb05379a3a7b287f6c8f2a8d0417d2bb0c4a676e62d8589'
AND (
token = 'Tdx85yQDXEmOY9M3XOu/KD/7jww235Z+ZfLDPSlqR7M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)