UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vp340qG1s/6uYo0maxe9Y7Wf2GmepjKzag6GW2tdwt8='
WHERE
key_id = '0bc603e6bc5100690e1eaefc37acd198d74ea4e25f4082327fa571ea9ce4b4e5'
AND (
token = 'Vp340qG1s/6uYo0maxe9Y7Wf2GmepjKzag6GW2tdwt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)