UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9cjLx4SKJK+YAuFzEnbq1int1AP0hl4C2wbKqbrt6V0='
WHERE
key_id = 'b2ef10d9c193033348e571f9dc8eeb102a3c19ab5e73c76910929e81620536ef'
AND (
token = '9cjLx4SKJK+YAuFzEnbq1int1AP0hl4C2wbKqbrt6V0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)