UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1/Hp98T19Bz9sPXGYBCzoH8VVAfZ0NmjEAdeHHfZVVg=' 
WHERE 
  key_id = '49d314311525c00a04a04eb6f1b89c122b6f8b00193cf58dcb2fac9cab6804af' 
  AND (
    token = '1/Hp98T19Bz9sPXGYBCzoH8VVAfZ0NmjEAdeHHfZVVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00080