UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U0+5yKOfha+KcAx+wXxCEOEOtnX6nMkC+ryLw1KTYwk=' 
WHERE 
  key_id = 'f41e4f47b8565a6fdd31219b2e4078dbbc3e4cbfae3a48ec7bc36c0611d4f65c' 
  AND (
    token = 'U0+5yKOfha+KcAx+wXxCEOEOtnX6nMkC+ryLw1KTYwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027