UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fmshm449MKk3OQ44GDlQ+UC1KdUbb5k+qOsuU/Xpkw=' 
WHERE 
  key_id = 'e25a3f3c46409036f906de1f272d180d82bc29bc91ef81b4ec678cce91fe55dd' 
  AND (
    token = '7fmshm449MKk3OQ44GDlQ+UC1KdUbb5k+qOsuU/Xpkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00086