UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpav+wY8zENmkaGnQl3DVxSlAgQG8Mw2CL5Fzfn4EXM='
WHERE
key_id = 'ca95c9891a119e0991dcd17831f8a8da5a49d1da6d5419d3327e02d2e94d73d2'
AND (
token = 'qpav+wY8zENmkaGnQl3DVxSlAgQG8Mw2CL5Fzfn4EXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)