UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iO1Ky/OuuQZaBYb+z0mzfNUMQHxSpRUmfhUJ5mVRKMQ=' 
WHERE 
  key_id = '9358a5c89063de7c51886a3127a8800ddeb0ce6381b0f00ac1fb032c08a3f7e1' 
  AND (
    token = 'iO1Ky/OuuQZaBYb+z0mzfNUMQHxSpRUmfhUJ5mVRKMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027