UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IcCc2TI8gNvuNp0qx7oVq147jsuHP43/x2SyAX2LxPk='
WHERE
key_id = '77c7682fb2f70fcfef888aacbedc9d2c800f0d63d09fafa1695d24eaf5ae116b'
AND (
token = 'IcCc2TI8gNvuNp0qx7oVq147jsuHP43/x2SyAX2LxPk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)