UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oAmI3zdy+p8ko3u3/UarmZ86Kb7ThAkNlk6baODd8NE='
WHERE
key_id = '6430a375c485d3e9997e6b1133f94631d9d61bdcc5f76e469d994d176d028736'
AND (
token = 'oAmI3zdy+p8ko3u3/UarmZ86Kb7ThAkNlk6baODd8NE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)