UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5+3wkruXWRE3iuIZZePw2iRCAUu9/1hCQL9pwUY9ZQY=' 
WHERE 
  key_id = '7299efb6eb53d243576f224a20006fe4250e94afbd82721c943ad7fd310e5b2b' 
  AND (
    token = '5+3wkruXWRE3iuIZZePw2iRCAUu9/1hCQL9pwUY9ZQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036