UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I5hu0fES4wFdsGM3YYMZrbifnZcfJJWu1/bnKSKaFUY='
WHERE
key_id = '7712099e4ac538fc21a3f6776d9e9a929d442061f2b57dff32c99edc6279d4bb'
AND (
token = 'I5hu0fES4wFdsGM3YYMZrbifnZcfJJWu1/bnKSKaFUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)