UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bAuj+MX6H8Na0m4dCtYgcEeG01Gy5Mh4Q9SeaTHgh80=' 
WHERE 
  key_id = 'f65d4ff7e5c2fff9bdaa3d306d667c8168389c5c229f38d39c18b42ca6ba6ed5' 
  AND (
    token = 'bAuj+MX6H8Na0m4dCtYgcEeG01Gy5Mh4Q9SeaTHgh80=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044