UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zrf3+lXkIWwD8gUH2+NX3icFtSmyh5qjQc+4FJpEGFA='
WHERE
key_id = '85e179f3c278c562029f0b87b693fb65ebcf2d38ce12ee9e4486159ce093a3c5'
AND (
token = 'zrf3+lXkIWwD8gUH2+NX3icFtSmyh5qjQc+4FJpEGFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)