UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DUVnEiQcTxJi/bZiK2SsgeldTJLwob+oRGhGuLDTVGo=' 
WHERE 
  key_id = '9c26f5cbc201d64c85cce557abd6ce0c1a2d641eaf5a4e993041041d6ec5a7c1' 
  AND (
    token = 'DUVnEiQcTxJi/bZiK2SsgeldTJLwob+oRGhGuLDTVGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036