UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9pVjXOE+eAzUwwmp678xOJ5Ww2/j5JakRvAFarDy6Rk=' 
WHERE 
  key_id = 'f13dc0a87141414cf03a6909c09f38079c631fa7ee1c8901cc7219b0471a7e01' 
  AND (
    token = '9pVjXOE+eAzUwwmp678xOJ5Ww2/j5JakRvAFarDy6Rk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020