UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iSZ/VWhQYDlyywRA65CVx2e3gRDpnCnZicr8fCDzBnA='
WHERE
key_id = 'e432ef338f5420fcf872fb5a2414b5bc95e1a79d2d3030fd3417142bf4f2f21f'
AND (
token = 'iSZ/VWhQYDlyywRA65CVx2e3gRDpnCnZicr8fCDzBnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)