UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eDBql1hCbkAA817eGH7C3zk+kgzgeFx/hLi44eVwxz8='
WHERE
key_id = '26ca5e836791af0579321183a8786e440c85872e0a66710638d4a21bd713e6f2'
AND (
token = 'eDBql1hCbkAA817eGH7C3zk+kgzgeFx/hLi44eVwxz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)