UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iJNOvktBYcBomRGT6Q75s6ZH0/ucx3XW4o5UZGhROak='
WHERE
key_id = '637496b7285678d63701bcdc6557a643d1d433d5179768667eb32e1d2561d90b'
AND (
token = 'iJNOvktBYcBomRGT6Q75s6ZH0/ucx3XW4o5UZGhROak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)