UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cctl88Nf+1+QRFvbq72h6rlyNK1Kb1o4/s5jPFlwou0='
WHERE
key_id = 'ccd36c8409ed9d4022f3641a5ee4a034e9f02b56b13557fef07240f9a7631415'
AND (
token = 'cctl88Nf+1+QRFvbq72h6rlyNK1Kb1o4/s5jPFlwou0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)