UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'txqnk21y6LPa8iWQROHmJC9ZUq6kEFhGzXGxlyKUcXs='
WHERE
key_id = '4d78bdad838be83b221a1c1667263badeef74fee521f4b6ca6524fccd5435fb6'
AND (
token = 'txqnk21y6LPa8iWQROHmJC9ZUq6kEFhGzXGxlyKUcXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)