UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hHDBGrtUGdy1nXGzlkv9fbNVxe6OTZn1J4Xx70HmRTA='
WHERE
key_id = 'e72050bebb50c10c660a772031e73d562fa65aee5ae8d0481e5d2078d0d9fac1'
AND (
token = 'hHDBGrtUGdy1nXGzlkv9fbNVxe6OTZn1J4Xx70HmRTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)