UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bSSYHof/BO/l0DJ4wn0A7N07yphae8LqspT1z75e7jM='
WHERE
key_id = '55b6e3559a10742a66343293b8f3c4e523f0c772a005abb789d7340ccee29f0c'
AND (
token = 'bSSYHof/BO/l0DJ4wn0A7N07yphae8LqspT1z75e7jM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)